Add which-key-enable-extended-define-key customization option
authorJustin Burkett <justin@burkett.cc>
Wed, 13 Dec 2017 15:56:25 +0000 (10:56 -0500)
committerJustin Burkett <justin@burkett.cc>
Wed, 13 Dec 2017 15:56:25 +0000 (10:56 -0500)
commitf516b84eab1e307d3ffaa181324dca12c3951936
treef807dfa9eb88587151b5534c90755f76de42735c
parent78a29434789c7e7af7b3cf10a548d6247a69d3a9
Add which-key-enable-extended-define-key customization option

Adds supporting which-key--process-define-key-args.

The docstring for the option is

Advise `define-key' to make which-key aware of definitions of the form

  (define-key KEYMAP KEY '("DESCRIPTION" . DEF))

With the advice, this definition will have the side effect of creating a
replacement in `which-key-replacement-alist' that replaces DEF with DESCRIPTION
when the key sequence ends in KEY. Using a cons cell like this is a valid
definition for `define-key'. All this does is to make which-key aware of it.

Since many higher level keybinding functions use `define-key' internally, this
will affect most if not all of those as well.

This variable must be set before loading which-key.
which-key.el